<template>
    <div>
        <div v-show="isShow">
        <div class="gray">&nbsp;&nbsp;&nbsp;区直资金</div>
            <div class="right-content" v-for="(item,index) in unitNameList" :key="index">
                <div class="title">{{item.idstrict_straight_name}}</div>
            </div>
        </div>
    </div>
</template>

<script>
import { getDistrictNameList } from '@/api/site'
export default {
  name: 'RightContent1',
  props: {
    title: {
      type: String,
      default: () => {
        return ''
      }
    },
    isShow: {
      type: Boolean,
      default: () => {
        return false
      }
    }
  },
  data () {
    return {
      unitNameList: []
    }
  },
  methods: {
    result () {
      this.$emit('result', 12)
    },
    init () {
      getDistrictNameList().then(ret => {
        let data = ret.data
        if (data.errcode === 1001) {
          this.unitNameList = data.data.list
        } else {
          this.$Modal.error({
            title: '获取数据失败，请稍后重试'
          })
        }
      })
    }
  },
  mounted () {
    this.init()
  }
}
</script>

<style scoped>
    .gray{
        height: 50px;
        background-color: #EEECED;
        line-height: 50px;
        font-size: 20px;
        color: #0166b6;
    }
    .right-content{
        margin: 0 auto;
    }
    .title{
        width: 495px;
        height: 50px;
        margin: 20px;
        background-color: #EEECED;
        color: #0166b6;
        font-size: 20px;
        line-height: 50px;
        text-align: center;
        float: left;
    }
</style>
